/* libfake437 - a library for the rendering of code page 437 `graphics'
 * Copyright (C) 2008, 2009 Jack Kelly <endgame.dos@gmail.com>
 *
 * This library is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 ** @node Primitive Operations
 ** @chapter Primitive Operations
 **/

#ifndef FAKE437_PRIMITIVE_H
#define FAKE437_PRIMITIVE_H

#ifdef __cplusplus
extern "C"{
#endif

/**
 ** @deftypefun {const SDL_Color*} f437_get_color @
 **   (F437Color @var{color})
 **
 ** Return the color that corresponds to the given
 ** @code{F437Color}. If @code{F437_COLOR_TRANSPARENT} is passed,
 ** return @code{NULL}. Do not free the returned pointer - it is owned
 ** by libfake437.
 **
 ** @end deftypefun
 **/
const SDL_Color* f437_get_color(F437Color color);

/**
 ** @deftypefun {const F437Font*} f437_get_font @
 **   (F437FontName @var{name})
 **
 ** Return a pointer to the F437Font named by @var{name}. Do not free
 ** the returned pointer - it is owned by libfake437.
 **
 ** @end deftypefun
 **/
const F437Font* f437_get_font(F437FontName name);

/**
 ** @deftypefun void f437_put_char     @
 **   (SDL_Surface*     @var{surface}, @
 **    const F437Font*  @var{font},    @
 **    int              @var{x},       @
 **    int              @var{y},       @
 **    int              @var{ch},      @
 **    const SDL_Color* @var{fg},      @
 **    const SDL_Color* @var{bg})
 **
 ** @code{f437_put_char} draws the character whose code is @var{ch} on
 ** @var{surface} using @var{font}. @var{x} and @var{y} define an
 ** offset on the surface in pixels. @var{fg} and @var{bg} are the
 ** foreground and background colors. If @code{NULL} is passed as
 ** either @var{fg} or @var{bg}, foreground or background pixels will
 ** not be drawn, respectively.
 **
 ** @end deftypefun
 **/
void f437_put_char(SDL_Surface* surface, const F437Font* font,
                   int x, int y, int ch,
                   const SDL_Color* fg, const SDL_Color* bg);

/**
 ** @deftypefun void f437_put_rect     @
 **   (SDL_Surface*     @var{surface}, @
 **    const F437Font*  @var{font},    @
 **    int              @var{x},       @
 **    int              @var{y},       @
 **    int              @var{width},   @
 **    int              @var{height},  @
 **    int              @var{ch},      @
 **    const SDL_Color* @var{fg},      @
 **    const SDL_Color* @var{bg})
 **
 ** @code{f437_put_rect} draws a rectangle using the character with
 ** code @var{ch} on @var{surface}, with font @var{font}. @var{x} and
 ** @var{y} are pixel offsets. @var{width} and @var{height} define the
 ** width and height of the rectangle in characters. @var{fg} and
 ** @var{bg} are the foreground and background colors.
 **
 ** @end deftypefun
 **/
void f437_put_rect(SDL_Surface* surface, const F437Font* font,
                   int x, int y, int width, int height,
                   int ch, const SDL_Color* fg, const SDL_Color* bg);

/**
 ** @deftypefun void f437_put_string   @
 **   (SDL_Surface*     @var{surface}, @
 **    const F437Font*  @var{font},    @
 **    int              @var{x},       @
 **    int              @var{y},       @
 **    const char*      @var{string},  @
 **    const SDL_Color* @var{fg},      @
 **    const SDL_Color* @var{bg})
 **
 ** @code{f437_put_string} writes a null-terminated string pointed to
 ** by @var{string} to @var{surface} using @var{font}. As with
 ** @code{f437_put_char}, @var{x} and @var{y} are offsets in pixels
 ** and @var{fg} and @var{bg} are the foreground and background colors
 ** to use.
 **
 ** @end deftypefun
 **/
void f437_put_string(SDL_Surface* surface, const F437Font* font,
                     int x, int y, const char* string,
                     const SDL_Color* fg, const SDL_Color* bg);

#ifdef __cplusplus
}
#endif

#endif
